import 'package:k3cloud_api/params/iface_model.dart';
import 'package:k3cloud_api/params/model/response_error.dart';
import 'package:k3cloud_api/params/model/success_entity.dart';

class ResponseStatus implements IModel {
  int? errorCode;
  bool? isSuccess;
  List<ResponseError>? errors;
  List<SuccessEntity>? successEntitys;
  List<dynamic>? successMessages;
  int? msgCode;

  ResponseStatus.fromJson(Map<String, dynamic> source) {
    var json = source["Result"]["ResponseStatus"];
    errorCode = json["ErrorCode"];
    isSuccess = json["IsSuccess"];
    errors = (json["Errors"] as List).map((i) => ResponseError.fromJson(i)).toList();
    successEntitys = (json["SuccessEntitys"] as List).map((i) => SuccessEntity.fromJson(i)).toList();
    successMessages = json["SuccessMessages"];
    msgCode = json["MsgCode"];
  }
  @override
  Map<String, dynamic> toJson() => {
    "ErrorCode": errorCode,
    "IsSuccess": isSuccess,
    "Errors": errors?.map((i) => i.toJson()).toList(),
    "SuccessEntitys": successEntitys?.map((i) => i.toJson()).toList(),
    "SuccessMessages": successMessages,
    "MsgCode": msgCode,
  };
}